<template>
	<view>
		<view v-if="isCanUse">
			<view>
				<view class='header'>
					<!-- <image src='../../static/pen.png'></image> -->
				</view>
				<view class='content'>
					<view>申请获取以下权限</view>
					<text>获得你的公开信息(昵称，头像、地区等)</text>
				</view>
				<button class="bottom" type='primary' @click="getUserProfile">
					登录授权
				</button>
			</view>
		</view>
		<view v-if="isCanUse2">
			<view>
				<view class='header'>
					<!-- <image src='../../static/pen.png'></image> -->
				</view>

				<view class='content'>
					<view>申请获取以下权限</view>
					<text>获得你的手机号用于绑定登录</text>
				</view>
				<button class='bottom' type='primary' open-type="getPhoneNumber" @getphonenumber="PhoneNumber">
					授权手机登录
				</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "login",
		props: {
			isCanUse: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
				code: "",
				SessionKey: '',
				OpenId: '',
				avatar: '',
				nick_name: "",
				avatarUrl: null,
				isCanUse2: false //默认为true
			}
		},
		onLoad() {
			console.log(this.isCanUse)
			console.log(uni.getStorageSync('isCanUse'))
			
		},
		methods: {
		
				
			
		}
	}
</script>

<style>

</style>
